home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1997 January / macpower199701.bin / AMUG / Programming_10 / Videotoolbox 96-08-22-c.sit / VideoToolbox / (Utilities) / CalibrateLuminance / GetALuminance.c < prev   
MacBinary  |  1995-01-07  |  3.9 KB  |  [TEXT/CWIE]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: MacBinary (archive/macBinary).

You can browse this item here: GetALuminance.c

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Sat Jan 7 21:03:58 1995, modified Sat Jan 7 21:03:58 1995, creator 'CWIE', type ASCII, 3129 bytes "GetALuminance.c" , at 0xcb9 514 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[CWIE]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0f 47 65 74 41 4c 75 | 6d 69 6e 61 6e 63 65 2e |..GetALu|minance.|
|00000010| 63 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |c.......|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 43 57 49 | 45 01 00 00 00 00 00 00 |.TEXTCWI|E.......|
|00000050| 00 00 00 00 00 0c 39 00 | 00 02 02 ab 34 f8 8e ab |......9.|....4...|
|00000060| 34 f8 8e 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |4.......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 2c c9 00 00 |........|....,...|
|00000080| 2f 2a 0d 47 65 74 41 4c | 75 6d 69 6e 61 6e 63 65 |/*.GetAL|uminance|
|00000090| 2e 63 0d a9 20 31 39 39 | 30 2d 31 39 39 35 20 44 |.c.. 199|0-1995 D|
|000000a0| 65 6e 69 73 20 47 2e 20 | 50 65 6c 6c 69 0d 54 77 |enis G. |Pelli.Tw|
|000000b0| 6f 20 73 75 62 72 6f 75 | 74 69 6e 65 73 20 75 73 |o subrou|tines us|
|000000c0| 65 64 20 62 79 20 43 61 | 6c 69 62 72 61 74 65 4c |ed by Ca|librateL|
|000000d0| 75 6d 69 6e 61 6e 63 65 | 2e 63 2e 20 50 72 6f 62 |uminance|.c. Prob|
|000000e0| 61 62 6c 79 20 6e 6f 74 | 20 75 73 65 66 75 6c 20 |ably not| useful |
|000000f0| 6f 75 74 73 69 64 65 20 | 74 68 61 74 20 63 6f 6e |outside |that con|
|00000100| 74 65 78 74 2e 0d 0d 48 | 49 53 54 4f 52 59 3a 0d |text...H|ISTORY:.|
|00000110| 37 2f 32 38 2f 39 30 09 | 64 67 70 09 77 72 6f 74 |7/28/90.|dgp.wrot|
|00000120| 65 20 69 74 2e 0d 39 2f | 32 34 2f 39 30 09 64 67 |e it..9/|24/90.dg|
|00000130| 70 09 63 68 61 6e 67 65 | 64 20 6e 42 61 63 6b 67 |p.change|d nBackg|
|00000140| 72 6f 75 6e 64 20 74 6f | 20 56 42 61 63 6b 67 72 |round to| VBackgr|
|00000150| 6f 75 6e 64 2e 0d 36 2f | 32 35 2f 39 31 20 64 67 |ound..6/|25/91 dg|
|00000160| 70 20 66 69 78 65 64 20 | 62 75 67 20 70 6f 69 6e |p fixed |bug poin|
|00000170| 74 65 64 20 6f 75 74 20 | 62 79 20 53 75 6a 65 65 |ted out |by Sujee|
|00000180| 74 20 50 61 75 6c 20 77 | 68 65 72 65 62 79 20 4c |t Paul w|hereby L|
|00000190| 54 6f 56 48 75 6e 74 28 | 29 20 6d 61 64 65 20 61 |ToVHunt(|) made a|
|000001a0| 20 73 75 70 65 72 66 6c | 75 6f 75 73 0d 63 61 6c | superfl|uous.cal|
|000001b0| 6c 20 74 6f 20 47 65 74 | 41 4c 75 6d 69 6e 61 6e |l to Get|ALuminan|
|000001c0| 63 65 28 29 20 77 69 74 | 68 20 66 72 61 6d 65 73 |ce() wit|h frames|
|000001d0| 3d 31 2c 20 66 6f 72 63 | 69 6e 67 20 75 73 65 20 |=1, forc|ing use |
|000001e0| 6f 66 20 74 68 65 20 41 | 2f 44 20 65 76 65 6e 20 |of the A|/D even |
|000001f0| 69 66 20 69 74 20 77 61 | 73 6e 27 74 20 61 76 61 |if it wa|sn't ava|
|00000200| 69 6c 61 62 6c 65 2e 0d | 4f 6e 20 61 20 6d 61 63 |ilable..|On a mac|
|00000210| 68 69 6e 65 20 77 69 74 | 68 6f 75 74 20 61 6e 20 |hine wit|hout an |
|00000220| 41 2f 44 20 63 61 72 64 | 20 74 68 69 73 20 77 6f |A/D card| this wo|
|00000230| 75 6c 64 20 63 61 75 73 | 65 20 43 61 6c 69 62 72 |uld caus|e Calibr|
|00000240| 61 74 65 4c 75 6d 69 6e | 61 6e 63 65 20 74 6f 20 |ateLumin|ance to |
|00000250| 66 61 69 6c 2e 0d 4f 6e | 20 6d 61 63 68 69 6e 65 |fail..On| machine|
|00000260| 73 20 77 69 74 68 20 61 | 6e 20 41 2f 44 20 63 61 |s with a|n A/D ca|
|00000270| 72 64 20 74 68 69 73 20 | 77 61 73 74 65 64 20 61 |rd this |wasted a|
|00000280| 20 73 65 63 6f 6e 64 20 | 6f 6e 20 65 61 63 68 20 | second |on each |
|00000290| 63 61 6c 6c 20 74 6f 20 | 4c 54 6f 56 48 75 6e 74 |call to |LToVHunt|
|000002a0| 28 29 2e 0d 38 2f 32 34 | 2f 39 31 09 64 67 70 09 |()..8/24|/91.dgp.|
|000002b0| 4d 61 64 65 20 63 6f 6d | 70 61 74 69 62 6c 65 20 |Made com|patible |
|000002c0| 77 69 74 68 20 54 48 49 | 4e 4b 20 43 20 35 2e 30 |with THI|NK C 5.0|
|000002d0| 2e 0d 31 32 2f 31 37 2f | 39 32 20 64 67 70 20 45 |..12/17/|92 dgp E|
|000002e0| 6e 68 61 6e 63 65 64 20 | 74 6f 20 73 75 70 70 6f |nhanced |to suppo|
|000002f0| 72 74 20 61 72 62 69 74 | 72 61 72 79 20 64 61 63 |rt arbit|rary dac|
|00000300| 53 69 7a 65 2e 20 52 65 | 70 6c 61 63 65 64 20 32 |Size. Re|placed 2|
|00000310| 35 36 20 62 79 20 4c 50 | 2d 3e 56 4d 61 78 2b 31 |56 by LP|->VMax+1|
|00000320| 20 0d 69 6e 20 4c 54 6f | 56 48 75 6e 74 2e 0d 31 | .in LTo|VHunt..1|
|00000330| 32 2f 32 31 2f 39 32 20 | 64 67 70 20 4e 6f 20 6c |2/21/92 |dgp No l|
|00000340| 6f 6e 67 65 72 20 6c 6f | 61 64 20 75 6e 75 73 65 |onger lo|ad unuse|
|00000350| 64 20 64 61 63 20 62 69 | 74 73 2e 0d 2a 2f 0d 23 |d dac bi|ts..*/.#|
|00000360| 69 6e 63 6c 75 64 65 20 | 22 56 69 64 65 6f 54 6f |include |"VideoTo|
|00000370| 6f 6c 62 6f 78 2e 68 22 | 0d 23 69 6e 63 6c 75 64 |olbox.h"|.#includ|
|00000380| 65 20 22 4c 75 6d 69 6e | 61 6e 63 65 2e 68 22 0d |e "Lumin|ance.h".|
|00000390| 0d 64 6f 75 62 6c 65 20 | 47 65 74 41 4c 75 6d 69 |.double |GetALumi|
|000003a0| 6e 61 6e 63 65 28 4c 75 | 6d 69 6e 61 6e 63 65 52 |nance(Lu|minanceR|
|000003b0| 65 63 6f 72 64 20 2a 4c | 50 2c 47 44 48 61 6e 64 |ecord *L|P,GDHand|
|000003c0| 6c 65 20 64 65 76 69 63 | 65 2c 0d 09 69 6e 74 20 |le devic|e,..int |
|000003d0| 66 72 61 6d 65 73 2c 64 | 6f 75 62 6c 65 20 4c 75 |frames,d|ouble Lu|
|000003e0| 6d 69 6e 61 6e 63 65 50 | 65 72 56 6f 6c 74 61 67 |minanceP|erVoltag|
|000003f0| 65 2c 69 6e 74 20 65 6e | 74 72 79 2c 69 6e 74 20 |e,int en|try,int |
|00000400| 72 65 64 2c 69 6e 74 20 | 67 72 65 65 6e 2c 69 6e |red,int |green,in|
|00000410| 74 20 62 6c 75 65 29 3b | 0d 76 6f 69 64 20 4c 54 |t blue);|.void LT|
|00000420| 6f 56 48 75 6e 74 28 4c | 75 6d 69 6e 61 6e 63 65 |oVHunt(L|uminance|
|00000430| 52 65 63 6f 72 64 20 2a | 4c 50 2c 47 44 48 61 6e |Record *|LP,GDHan|
|00000440| 64 6c 65 20 64 65 76 69 | 63 65 2c 43 57 69 6e 64 |dle devi|ce,CWind|
|00000450| 6f 77 50 74 72 20 77 69 | 6e 64 6f 77 2c 0d 09 64 |owPtr wi|ndow,..d|
|00000460| 6f 75 62 6c 65 20 4c 75 | 6d 69 6e 61 6e 63 65 50 |ouble Lu|minanceP|
|00000470| 65 72 56 6f 6c 74 61 67 | 65 2c 69 6e 74 20 66 72 |erVoltag|e,int fr|
|00000480| 61 6d 65 73 2c 64 6f 75 | 62 6c 65 20 64 61 72 6b |ames,dou|ble dark|
|00000490| 4c 75 6d 69 6e 61 6e 63 | 65 29 3b 0d 0d 0d 64 6f |Luminanc|e);...do|
|000004a0| 75 62 6c 65 20 47 65 74 | 41 4c 75 6d 69 6e 61 6e |uble Get|ALuminan|
|000004b0| 63 65 28 4c 75 6d 69 6e | 61 6e 63 65 52 65 63 6f |ce(Lumin|anceReco|
|000004c0| 72 64 20 2a 4c 50 2c 47 | 44 48 61 6e 64 6c 65 20 |rd *LP,G|DHandle |
|000004d0| 64 65 76 69 63 65 2c 0d | 09 69 6e 74 20 66 72 61 |device,.|.int fra|
|000004e0| 6d 65 73 2c 64 6f 75 62 | 6c 65 20 4c 75 6d 69 6e |mes,doub|le Lumin|
|000004f0| 61 6e 63 65 50 65 72 56 | 6f 6c 74 61 67 65 2c 69 |ancePerV|oltage,i|
|00000500| 6e 74 20 65 6e 74 72 79 | 2c 69 6e 74 20 72 65 64 |nt entry|,int red|
|00000510| 2c 69 6e 74 20 67 72 65 | 65 6e 2c 69 6e 74 20 62 |,int gre|en,int b|
|00000520| 6c 75 65 29 0d 2f 2a 0d | 47 65 74 20 6c 75 6d 69 |lue)./*.|Get lumi|
|00000530| 6e 61 6e 63 65 20 70 72 | 6f 64 75 63 65 64 20 62 |nance pr|oduced b|
|00000540| 79 20 61 6e 20 52 47 42 | 20 74 72 69 70 6c 65 74 |y an RGB| triplet|
|00000550| 2e 20 49 66 20 66 72 61 | 6d 65 73 3d 3d 30 20 74 |. If fra|mes==0 t|
|00000560| 68 65 6e 20 61 73 6b 20 | 66 6f 72 20 6d 61 6e 75 |hen ask |for manu|
|00000570| 61 6c 0d 72 65 61 64 69 | 6e 67 2e 20 49 66 20 66 |al.readi|ng. If f|
|00000580| 72 61 6d 65 73 21 3d 30 | 20 74 68 65 6e 20 75 73 |rames!=0| then us|
|00000590| 65 20 41 2f 44 20 74 6f | 20 6d 61 6b 65 20 61 75 |e A/D to| make au|
|000005a0| 74 6f 6d 61 74 69 63 20 | 72 65 61 64 69 6e 67 2e |tomatic |reading.|
|000005b0| 0d 2a 2f 0d 7b 0d 09 73 | 74 61 74 69 63 20 64 6f |.*/.{..s|tatic do|
|000005c0| 75 62 6c 65 20 4c 3b 0d | 09 73 74 61 74 69 63 20 |uble L;.|.static |
|000005d0| 63 68 61 72 20 73 74 72 | 69 6e 67 5b 31 30 30 5d |char str|ing[100]|
|000005e0| 3b 0d 09 6c 6f 6e 67 20 | 66 69 6e 61 6c 54 69 63 |;..long |finalTic|
|000005f0| 6b 73 3b 0d 09 73 68 6f | 72 74 20 6c 65 66 74 3b |ks;..sho|rt left;|
|00000600| 0d 0d 09 4c 50 2d 3e 64 | 61 63 53 69 7a 65 3d 4c |...LP->d|acSize=L|
|00000610| 6f 67 32 4c 28 4c 50 2d | 3e 56 4d 61 78 2a 32 2d |og2L(LP-|>VMax*2-|
|00000620| 31 29 3b 09 2f 2f 20 69 | 6e 20 62 69 74 73 2c 20 |1);.// i|n bits, |
|00000630| 72 6f 75 6e 64 65 64 20 | 75 70 0d 09 6c 65 66 74 |rounded |up..left|
|00000640| 3d 4c 50 2d 3e 6c 65 66 | 74 53 68 69 66 74 3d 31 |=LP->lef|tShift=1|
|00000650| 36 2d 4c 50 2d 3e 64 61 | 63 53 69 7a 65 3b 0d 09 |6-LP->da|cSize;..|
|00000660| 4c 50 2d 3e 74 61 62 6c | 65 5b 65 6e 74 72 79 5d |LP->tabl|e[entry]|
|00000670| 2e 72 67 62 2e 72 65 64 | 20 20 20 3d 20 72 65 64 |.rgb.red| = red|
|00000680| 3c 3c 6c 65 66 74 3b 0d | 09 4c 50 2d 3e 74 61 62 |<<left;.|.LP->tab|
|00000690| 6c 65 5b 65 6e 74 72 79 | 5d 2e 72 67 62 2e 67 72 |le[entry|].rgb.gr|
|000006a0| 65 65 6e 20 3d 20 67 72 | 65 65 6e 3c 3c 6c 65 66 |een = gr|een<<lef|
|000006b0| 74 3b 0d 09 4c 50 2d 3e | 74 61 62 6c 65 5b 65 6e |t;..LP->|table[en|
|000006c0| 74 72 79 5d 2e 72 67 62 | 2e 62 6c 75 65 20 20 3d |try].rgb|.blue =|
|000006d0| 20 62 6c 75 65 3c 3c 6c | 65 66 74 3b 0d 09 4c 6f | blue<<l|eft;..Lo|
|000006e0| 61 64 4c 75 6d 69 6e 61 | 6e 63 65 73 28 64 65 76 |adLumina|nces(dev|
|000006f0| 69 63 65 2c 4c 50 2c 65 | 6e 74 72 79 2c 65 6e 74 |ice,LP,e|ntry,ent|
|00000700| 72 79 29 3b 09 09 2f 2a | 20 6c 6f 61 64 20 63 6c |ry);../*| load cl|
|00000710| 75 74 20 65 6e 74 72 79 | 20 2a 2f 0d 09 69 66 28 |ut entry| */..if(|
|00000720| 66 72 61 6d 65 73 29 7b | 0d 09 09 44 65 6c 61 79 |frames){|...Delay|
|00000730| 28 36 30 4c 2c 26 66 69 | 6e 61 6c 54 69 63 6b 73 |(60L,&fi|nalTicks|
|00000740| 29 3b 09 09 09 09 09 2f | 2a 20 77 61 69 74 20 66 |);...../|* wait f|
|00000750| 6f 72 20 70 68 6f 74 6f | 6d 65 74 65 72 20 74 6f |or photo|meter to|
|00000760| 20 73 65 74 74 6c 65 20 | 2a 2f 0d 09 09 4c 6f 61 | settle |*/...Loa|
|00000770| 64 4c 75 6d 69 6e 61 6e | 63 65 73 28 64 65 76 69 |dLuminan|ces(devi|
|00000780| 63 65 2c 4c 50 2c 65 6e | 74 72 79 2c 65 6e 74 72 |ce,LP,en|try,entr|
|00000790| 79 29 3b 09 2f 2a 20 73 | 79 6e 63 68 72 6f 6e 69 |y);./* s|ynchroni|
|000007a0| 7a 65 20 74 6f 20 64 69 | 73 70 6c 61 79 20 2a 2f |ze to di|splay */|
|000007b0| 0d 09 09 4c 3d 56 6f 6c | 74 73 44 75 72 69 6e 67 |...L=Vol|tsDuring|
|000007c0| 46 72 61 6d 65 28 66 72 | 61 6d 65 73 29 2a 4c 75 |Frame(fr|ames)*Lu|
|000007d0| 6d 69 6e 61 6e 63 65 50 | 65 72 56 6f 6c 74 61 67 |minanceP|erVoltag|
|000007e0| 65 3b 0d 09 7d 0d 09 65 | 6c 73 65 7b 0d 09 09 70 |e;..}..e|lse{...p|
|000007f0| 72 69 6e 74 66 28 22 50 | 6c 65 61 73 65 20 65 6e |rintf("P|lease en|
|00000800| 74 65 72 20 6c 75 6d 69 | 6e 61 6e 63 65 20 69 6e |ter lumi|nance in|
|00000810| 20 25 73 20 28 25 34 2e | 31 66 29 3a 22 2c 4c 50 | %s (%4.|1f):",LP|
|00000820| 2d 3e 75 6e 69 74 73 2c | 4c 29 3b 0d 09 09 67 65 |->units,|L);...ge|
|00000830| 74 73 28 73 74 72 69 6e | 67 29 3b 0d 09 09 73 73 |ts(strin|g);...ss|
|00000840| 63 61 6e 66 28 28 63 68 | 61 72 20 2a 29 73 74 72 |canf((ch|ar *)str|
|00000850| 69 6e 67 2c 22 25 6c 66 | 22 2c 26 4c 29 3b 0d 09 |ing,"%lf|",&L);..|
|00000860| 7d 0d 09 72 65 74 75 72 | 6e 20 4c 3b 0d 7d 0d 0d |}..retur|n L;.}..|
|00000870| 0d 76 6f 69 64 20 4c 54 | 6f 56 48 75 6e 74 28 4c |.void LT|oVHunt(L|
|00000880| 75 6d 69 6e 61 6e 63 65 | 52 65 63 6f 72 64 20 2a |uminance|Record *|
|00000890| 4c 50 2c 47 44 48 61 6e | 64 6c 65 20 64 65 76 69 |LP,GDHan|dle devi|
|000008a0| 63 65 2c 43 57 69 6e 64 | 6f 77 50 74 72 20 77 69 |ce,CWind|owPtr wi|
|000008b0| 6e 64 6f 77 2c 0d 09 64 | 6f 75 62 6c 65 20 4c 75 |ndow,..d|ouble Lu|
|000008c0| 6d 69 6e 61 6e 63 65 50 | 65 72 56 6f 6c 74 61 67 |minanceP|erVoltag|
|000008d0| 65 2c 69 6e 74 20 66 72 | 61 6d 65 73 2c 64 6f 75 |e,int fr|ames,dou|
|000008e0| 62 6c 65 20 64 61 72 6b | 4c 75 6d 69 6e 61 6e 63 |ble dark|Luminanc|
|000008f0| 65 29 0d 2f 2a 0d 66 69 | 6e 64 73 20 74 68 65 20 |e)./*.fi|nds the |
|00000900| 44 41 43 20 73 65 74 74 | 69 6e 67 20 6a 2c 20 73 |DAC sett|ing j, s|
|00000910| 75 63 68 20 74 68 61 74 | 20 74 68 65 20 64 65 73 |uch that| the des|
|00000920| 69 72 65 64 20 6c 75 6d | 69 6e 61 6e 63 65 20 69 |ired lum|inance i|
|00000930| 73 0d 62 65 74 77 65 65 | 6e 20 4c 6a 20 61 6e 64 |s.betwee|n Lj and|
|00000940| 20 4c 6a 2b 31 2e 20 54 | 68 69 73 20 69 73 20 61 | Lj+1. T|his is a|
|00000950| 63 68 69 65 76 65 64 20 | 62 79 20 61 63 74 75 61 |chieved |by actua|
|00000960| 6c 6c 79 20 6d 65 61 73 | 75 72 69 6e 67 0d 74 68 |lly meas|uring.th|
|00000970| 65 20 72 65 73 75 6c 74 | 69 6e 67 20 6c 75 6d 69 |e result|ing lumi|
|00000980| 6e 61 6e 63 65 73 2c 20 | 62 65 66 6f 72 65 20 74 |nances, |before t|
|00000990| 68 65 20 4c 75 6d 69 6e | 61 6e 63 65 52 65 63 6f |he Lumin|anceReco|
|000009a0| 72 64 20 69 73 0d 66 75 | 6c 6c 79 20 64 65 66 69 |rd is.fu|lly defi|
|000009b0| 6e 65 64 2e 20 54 68 65 | 20 73 65 61 72 63 68 20 |ned. The| search |
|000009c0| 70 72 6f 63 65 65 64 73 | 20 62 79 20 62 69 73 65 |proceeds| by bise|
|000009d0| 63 74 69 6f 6e 3a 0d 4c | 50 2d 3e 4c 42 61 63 6b |ction:.L|P->LBack|
|000009e0| 67 72 6f 75 6e 64 3d 3d | 64 65 73 69 72 65 64 20 |ground==|desired |
|000009f0| 6c 75 6d 69 6e 61 6e 63 | 65 3b 0d 4c 50 2d 3e 56 |luminanc|e;.LP->V|
|00000a00| 42 61 63 6b 67 72 6f 75 | 6e 64 3d 3d 6a 3b 0d 2a |Backgrou|nd==j;.*|
|00000a10| 2f 0d 7b 0d 09 69 6e 74 | 20 6a 75 2c 6a 6d 2c 6a |/.{..int| ju,jm,j|
|00000a20| 6c 3b 0d 09 64 6f 75 62 | 6c 65 20 4c 4d 65 61 73 |l;..doub|le LMeas|
|00000a30| 75 72 65 64 3b 0d 09 57 | 69 6e 64 6f 77 50 74 72 |ured;..W|indowPtr|
|00000a40| 20 6f 6c 64 57 69 6e 64 | 6f 77 3b 0d 09 69 6e 74 | oldWind|ow;..int|
|00000a50| 20 69 6e 64 65 78 3d 31 | 3b 0d 0d 09 47 65 74 50 | index=1|;...GetP|
|00000a60| 6f 72 74 28 26 6f 6c 64 | 57 69 6e 64 6f 77 29 3b |ort(&old|Window);|
|00000a70| 0d 09 53 65 74 50 6f 72 | 74 28 28 57 69 6e 64 6f |..SetPor|t((Windo|
|00000a80| 77 50 74 72 29 77 69 6e | 64 6f 77 29 3b 0d 09 42 |wPtr)win|dow);..B|
|00000a90| 72 69 6e 67 54 6f 46 72 | 6f 6e 74 28 28 57 69 6e |ringToFr|ont((Win|
|00000aa0| 64 6f 77 50 74 72 29 77 | 69 6e 64 6f 77 29 3b 0d |dowPtr)w|indow);.|
|00000ab0| 09 50 6d 42 61 63 6b 43 | 6f 6c 6f 72 28 69 6e 64 |.PmBackC|olor(ind|
|00000ac0| 65 78 29 3b 0d 09 45 72 | 61 73 65 52 65 63 74 28 |ex);..Er|aseRect(|
|00000ad0| 26 77 69 6e 64 6f 77 2d | 3e 70 6f 72 74 52 65 63 |&window-|>portRec|
|00000ae0| 74 29 3b 0d 09 6a 6c 3d | 30 3b 0d 09 6a 75 3d 4c |t);..jl=|0;..ju=L|
|00000af0| 50 2d 3e 56 4d 61 78 2b | 31 3b 0d 09 77 68 69 6c |P->VMax+|1;..whil|
|00000b00| 65 20 28 6a 75 2d 6a 6c | 20 3e 20 31 29 20 7b 0d |e (ju-jl| > 1) {.|
|00000b10| 09 09 6a 6d 3d 28 6a 75 | 2b 6a 6c 29 2f 32 3b 0d |..jm=(ju|+jl)/2;.|
|00000b20| 09 09 4c 4d 65 61 73 75 | 72 65 64 3d 47 65 74 41 |..LMeasu|red=GetA|
|00000b30| 4c 75 6d 69 6e 61 6e 63 | 65 28 4c 50 2c 64 65 76 |Luminanc|e(LP,dev|
|00000b40| 69 63 65 2c 66 72 61 6d | 65 73 2c 4c 75 6d 69 6e |ice,fram|es,Lumin|
|00000b50| 61 6e 63 65 50 65 72 56 | 6f 6c 74 61 67 65 0d 09 |ancePerV|oltage..|
|00000b60| 09 09 2c 69 6e 64 65 78 | 2c 6a 6d 2c 6a 6d 2c 6a |..,index|,jm,jm,j|
|00000b70| 6d 29 3b 0d 09 09 4c 4d | 65 61 73 75 72 65 64 2d |m);...LM|easured-|
|00000b80| 3d 64 61 72 6b 4c 75 6d | 69 6e 61 6e 63 65 3b 0d |=darkLum|inance;.|
|00000b90| 09 09 69 66 20 28 4c 50 | 2d 3e 4c 42 61 63 6b 67 |..if (LP|->LBackg|
|00000ba0| 72 6f 75 6e 64 20 3e 20 | 4c 4d 65 61 73 75 72 65 |round > |LMeasure|
|00000bb0| 64 29 0d 09 09 09 6a 6c | 3d 6a 6d 3b 0d 09 09 65 |d)....jl|=jm;...e|
|00000bc0| 6c 73 65 0d 09 09 09 6a | 75 3d 6a 6d 3b 0d 09 7d |lse....j|u=jm;..}|
|00000bd0| 0d 09 4c 50 2d 3e 56 42 | 61 63 6b 67 72 6f 75 6e |..LP->VB|ackgroun|
|00000be0| 64 3d 6a 6c 3b 0d 09 4c | 50 2d 3e 74 61 62 6c 65 |d=jl;..L|P->table|
|00000bf0| 5b 69 6e 64 65 78 5d 2e | 72 67 62 3d 28 2a 2a 28 |[index].|rgb=(**(|
|00000c00| 2a 2a 28 2a 2a 64 65 76 | 69 63 65 29 2e 67 64 50 |**(**dev|ice).gdP|
|00000c10| 4d 61 70 29 2e 70 6d 54 | 61 62 6c 65 29 2e 63 74 |Map).pmT|able).ct|
|00000c20| 54 61 62 6c 65 5b 69 6e | 64 65 78 5d 2e 72 67 62 |Table[in|dex].rgb|
|00000c30| 3b 0d 09 4c 6f 61 64 4c | 75 6d 69 6e 61 6e 63 65 |;..LoadL|uminance|
|00000c40| 73 28 64 65 76 69 63 65 | 2c 4c 50 2c 69 6e 64 65 |s(device|,LP,inde|
|00000c50| 78 2c 69 6e 64 65 78 29 | 3b 09 09 2f 2a 20 72 65 |x,index)|;../* re|
|00000c60| 73 74 6f 72 65 20 63 6c | 75 74 20 65 6e 74 72 79 |store cl|ut entry|
|00000c70| 20 2a 2f 0d 09 53 65 6e | 64 42 65 68 69 6e 64 28 | */..Sen|dBehind(|
|00000c80| 28 57 69 6e 64 6f 77 50 | 74 72 29 77 69 6e 64 6f |(WindowP|tr)windo|
|00000c90| 77 2c 4e 55 4c 4c 29 3b | 0d 09 53 65 74 50 6f 72 |w,NULL);|..SetPor|
|00000ca0| 74 28 6f 6c 64 57 69 6e | 64 6f 77 29 3b 0d 09 72 |t(oldWin|dow);..r|
|00000cb0| 65 74 75 72 6e 3b 0d 7d | 0d 00 00 00 00 00 00 00 |eturn;.}|........|
|00000cc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000cd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ce0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000cf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d00| 00 00 01 00 00 00 01 9c | 00 00 00 9c 00 00 00 66 |........|.......f|
|00000d10| 00 00 00 0c be 00 00 18 | c2 00 00 00 0c 00 00 00 |........|........|
|00000d20| 00 00 00 00 00 00 08 00 | 00 00 00 00 00 00 0e 00 |........|........|
|00000d30| 0f 47 65 74 41 4c 75 6d | 69 6e 61 6e 63 65 2e 63 |.GetALum|inance.c|
|00000d40| 02 00 00 00 54 45 58 54 | 43 57 49 45 01 00 00 b4 |....TEXT|CWIE....|
|00000d50| 00 00 54 45 58 54 43 57 | 49 45 01 00 00 b4 00 00 |..TEXTCW|IE......|
|00000d60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d70| 00 00 a3 52 91 93 00 00 | 0c 39 00 00 02 02 00 00 |...R....|.9......|
|00000d80| 01 00 00 07 a8 00 00 00 | ce 00 00 00 00 00 00 00 |........|........|
|00000d90| 00 00 00 0c da 00 00 18 | d2 00 00 00 0c 00 00 00 |........|........|
|00000da0| 00 00 00 00 00 00 08 00 | 00 00 00 00 00 00 0e 00 |........|........|
|00000db0| 08 00 00 00 00 00 00 00 | 00 03 02 00 ea 00 00 00 |........|........|
|00000dc0| 01 00 00 07 b0 00 00 00 | ce 00 00 00 00 00 00 00 |........|........|
|00000dd0| 00 00 00 0c e8 00 00 18 | da 00 00 00 0c 00 00 00 |........|........|
|00000de0| 00 00 00 00 00 00 08 00 | 00 00 00 00 00 00 0e 00 |........|........|
|00000df0| 04 00 00 00 00 00 00 00 | 00 03 02 00 eb 00 00 00 |........|........|
|00000e00| 00 00 00 2a 00 02 00 00 | 04 25 00 00 04 32 0d 47 |...*....|.%...2.G|
|00000e10| 65 74 41 4c 75 6d 69 6e | 61 6e 63 65 00 00 07 f6 |etALumin|ance....|
|00000e20| 00 00 07 fe 09 4c 54 6f | 56 48 75 6e 74 00 00 00 |.....LTo|VHunt...|
|00000e30| 00 48 00 09 4d 6f 6e 61 | 63 6f 00 00 00 00 00 00 |.H..Mona|co......|
|00000e40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000e50| 00 00 00 00 00 03 00 04 | 00 50 00 09 01 80 02 68 |........|.P.....h|
|00000e60| 00 50 00 09 01 80 02 68 | ab 34 c0 57 00 00 00 1e |.P.....h|.4.W....|
|00000e70| 00 00 00 1e 00 00 00 00 | 01 00 00 00 00 04 00 01 |........|........|
|00000e80| 00 01 00 00 00 16 00 01 | 00 14 00 00 05 82 00 26 |........|.......&|
|00000e90| 01 c6 3f 40 00 00 05 6c | 65 66 74 20 00 00 01 00 |..?@...l|eft ....|
|00000ea0| 00 00 01 9c 00 00 00 9c | 00 00 00 66 01 53 cb 40 |........|...f.S.@|
|00000eb0| 18 fa 00 00 00 1c 00 66 | 00 02 4d 50 53 52 00 01 |.......f|..MPSR..|
|00000ec0| 00 1a 4d 57 42 42 00 00 | 00 32 44 54 56 55 00 00 |..MWBB..|.2DTVU..|
|00000ed0| 00 3e 03 ef ff ff 00 00 | 00 00 00 00 00 00 03 ed |.>......|........|
|00000ee0| ff ff 00 00 00 2e 00 00 | 00 00 03 f0 ff ff 00 00 |........|........|
|00000ef0| 00 7a 00 00 00 00 47 ba | ff ff 00 00 00 82 00 00 |.z....G.|........|
|00000f00| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000f70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+